/*通知面试验证*/
	$('#noticeInterviewForm').validate({
        /*onkeyup: false,
    	focusCleanup:true,*/
        rules: {
        	subject: {
    	    	required: true,
    	    	maxlength:200
    	   	},
    	   	interTime: {
    	    	required: true
    	   	},
    	   	interAdd: {
    	    	required: true,
    	    	maxlength:200
    	   	},
    	   	linkMan:{
    	   		required: false,
    	   		//add nancy
    	   		rangelength: [2,16]
    	   	},
    	   	linkPhone: {
    	    	required: true,
    	    	isTel:true,
    	    	maxlength:30
    	   	},
    	   	content:{
    	   		required: false,
    	    	maxlength:500
    	   	}
    	},
    	messages: {
    		subject: {
    	    	required: "请输入你的主题",
    	    	maxlength:"请输入200字符以内的主题"
    	   	},
    	   	interTime: {
    	    	required: "请输入你的面试时间"
    	   	},
    	   	interAdd: {
    	    	required: "请输入你的面试地点",
    	    	maxlength:"请输入200字符以内的面试地点"
    	   	},
    	   	linkPhone: {
    	    	required: "请输入你的联系电话",
    	    	isTel:"请输入正确的手机号或座机号，座机格式如010-62555255或010-6255255-分机号，多个电话用英文逗号隔开",
    	    	maxlength:"请输入30字以内的联系电话"
    	   	},
    	   	//add nancy
    	   	linkMan:{
    	   		rangelength:"请输入2-16个字符的联系人"
    	   	},
    	   	//end nancy
    	   	content:{
    	    	maxlength:"请输入500字符以内的补充内容"
    	   	}
    	},
    	submitHandler:function(form){
    		var _form = $(form);
    		//_form.find(":submit").attr("disabled", "disabled");
    		var email = $(".receiveEmail").val();
    		var subject = $('input[name="subject"]',form).val();
    		var interTime = $('input[name="interTime"]',form).val();
    		var interAdd = $('input[name="interAdd"]',form).val();
    		var linkMan = $('input[name="linkMan"]',form).val();
    		var linkPhone = $('input[name="linkPhone"]',form).val();
    		var content = $('textarea[name="content"]',form).val();
    		var params = "flag=interview"+"&jrid="+jrid+"&mailFrom=ycrjhr@www.ycrjhr.com"+"&sessionId="+$.cookie("sessionId")+"&mailTo="+email+"&et.theme="+subject+"&ivTime="+interTime+"&et.interview="+interAdd+"&et.contact="+linkMan+"&et.telephone="+linkPhone+"&et.other="+content;
    		$.ajax({  
    	       type : 'post',  
    	       url : 'manageResume.action',  
    	       dataType : 'json',  
    	       data :  {"params":params},
    	  	   success : function (result) {
   	  	   	   if(result.errcode==0){
   	  	   		   //alert("面试通知发送成功！");
   	  	   		   //window.open("./haveRefuselist.jsp","_top");
   	  	   		   delayURL("面试通知发送成功！","3","./haveRefuselist.jsp");  
   	  	   	   }
    	       },  
    	       error : function () {  
    	    	    delayURL("面试通知发送失败！请稍后再试。","3","");  
    	       		return;
    	       }  
    	    });	 
            /*$.ajax({
            	type:"post",
            	data:{
            		flag:"interview",
            		jrid:jrid,
            		mailTo:email,
            		theme:subject,
            		ivTime:interTime,
            		interview:interAdd,
            		contact:linkMan,
            		telephone:linkPhone,
            		other:content
            	},
            	url:"manageResume.action",
            	dataType:"json",
    			beforeSend: function(){
    				_form.find(":submit").attr("disabled", "disabled");
    			}
            }).done(function(result) {
            	alert(result.errcode);
				if(result.state == 1){
					$.colorbox({inline:true, href:$("#noticeInterviewSuccess"),title:"通知面试"});
				}else if(result.state == 500){
					$.colorbox({inline:true, href:$("#statusChange"),title:"简历状态变化"});
				}
				else{
					alert(result.message);
				}
				_form.find(":submit").attr("disabled", false);
            });*/
        }
	});
	/*预览通知面试邮件*/
	$('#noticeInterview .emailPreview').bind('click',function(){
		var name = $('#noticeInterview input[name="email"]').val();
		var email = $('#noticeInterviewForm input[name="email"]').val();
		var subject = $('#noticeInterviewForm input[name="subject"]').val();
		var interTime = $('#noticeInterviewForm input[name="interTime"]').val();
		var interAdd = $('#noticeInterviewForm input[name="interAdd"]').val();
		var linkMan = $('#noticeInterviewForm input[name="linkMan"]').val();
		var linkPhone = $('#noticeInterviewForm input[name="linkPhone"]').val();
		var content = $('#noticeInterviewForm textarea[name="content"]').val();
		content = content.replace("/\r\n/g","<br>");
		$('#noticeInterviewPreview .f18').html(subject);
        $('#noticeInterviewPreview .c9 span').html(email);
		var emailText = name + '，您好：<br />您的简历已通过我们的筛选，很高兴通知您参加我们的面试。<br /><br />'+
						'面试时间：'+interTime+'<br />面试地点：' + interAdd + '<br />';
		if(linkMan != ''){
			emailText += '联系人：'+linkMan +'<br />';
		}
		emailText += '联系电话：'+linkPhone;
		if(content){
			emailText += '<br /><br />' + content;
		}
        $('#emailText').html("补充内容："+emailText);
        var hasError = false;
        if(subject =='' || $('#noticeInterviewForm input[name="subject"]').hasClass('error')){
        	hasError = true;
        }
        if(interTime =='' || $('#noticeInterviewForm input[name="interTime"]').hasClass('error')){
        	hasError = true;
        }
        if(interAdd =='' || $('#noticeInterviewForm input[name="interAdd"]').hasClass('error')){
        	hasError = true;
        }
        if(linkPhone =='' || $('#noticeInterviewForm input[name="linkPhone"]').hasClass('error')){
        	hasError = true;
        }
        if($('#noticeInterviewForm textarea[name="content"]').hasClass('error')){
        	hasError = true;
        }
        if(hasError){
        	$('#noticeInterviewPreview .btn').hide();
        }else{
        	$('#noticeInterviewPreview .btn').show();
        }
        $.colorbox({inline:true, href:$("#noticeInterviewPreview"),title:"面试通知"});
	});	
	
	$(".back_cboxElement").click(function(){
		$.colorbox({inline:true, href:$("#noticeInterview"),title:"面试通知"});
	});
	
	//多选
	$('.filter_actions .checkbox input').bind('click',function(){
		if($(this).attr('checked')){
			$(this).removeAttr('checked');
			$(this).siblings('i').fadeOut(200);
			$('.resume_lists li').each(function(){
				$('.checkbox i',this).fadeOut(200);
				$('.checkbox input',this).removeAttr('checked');
				$('.checkbox',this).removeClass('checkhover');
			});
		}else{
			$(this).attr('checked','checked');
			$(this).siblings('i').fadeIn(200);
			$('.resume_lists li').each(function(){
				//8.21
				if($('.checkbox input',this).prop('disabled')){
					$('.checkbox i',this).fadeOut(200);
				}else{
					$('.checkbox i',this).fadeIn(200);
				}
				//$('.checkbox i',this).fadeIn(200);
				$('.checkbox input',this).attr('checked','checked');
				$('.checkbox',this).removeClass('checkhover');
			});
		}
		$(this).parent().removeClass('checkhover');
		return false;
	});
	
	